/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rd.project.service;

import com.rd.project.model.Test;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Mathias
 */
@Stateless
public class TestServiceImpl implements TestService{
    
    @PersistenceContext
    private EntityManager em;
    
    @Override
    public int getTestId(String test) {
        Query q = em.createQuery("SELECT t.Id FROM Test t where t.naam = :test");
        q.setParameter("test", test);
        return (int)q.getSingleResult();
    }
    
}
